"use strict";
const electron = require("electron");
const path = require("path");
const createWindow = () => {
  const win = new electron.BrowserWindow({
    webPreferences: {
      preload: path.join(__dirname, "./preload.js")
      // 需要引用js文件
    },
    autoHideMenuBar: true,
    height: 400,
    width: 600,
    icon: "src/assets/favicon.ico"
  });
  win.loadURL("http://localhost:5173");
};
electron.app.whenReady().then(() => {
  createWindow();
});
electron.ipcMain.handle("showNameDialog", async () => {
  const result = await electron.dialog.showMessageBox({
    title: "你还未实名",
    message: "检测到你还未实名，暂不能使用本软件，你是否要去实名？",
    type: "info",
    buttons: ["确定", "取消"]
  });
  console.log(result);
  return result.response;
});
